﻿@model User
@using BBICMS.Infrastructure.UI

<tr class="item-container">
    <td>
        <!-- Split button -->
        <div class="btn-group">
            <button type="button" class="btn btn-primary">操作</button>
            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu ">
                <li>
                    @Ajax.RawActionLink("<i class='fa fa-eye fa-fw'></i>查看",
                        "Details", "User",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "detail-container", OnComplete = "onAjaxComplete",OnSuccess= "OnSuccessLink" },
                        new { title = "查看用户资料" })

                </li>
                <li>
                    @Ajax.RawActionLink("<i class='fa fa-edit fa-fw'></i>编辑",
                        "Edit", "User",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "edit-container", OnComplete = "onAjaxEditComplete", OnSuccess = "OnSuccessLink" },
                        new { title = "编辑用户资料" })
                </li>
                <li role="separator" class="divider"></li>
                <li>
                    @Ajax.RawActionLink("<i class='fa fa-user-secret fa-fw'></i>角色设置",
                        "SetRole", "User",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "role-container", OnComplete = "onAjaxRoleComplete", OnSuccess = "OnSuccessLink" },
                        new { title = "角色设置" })
                </li>
                <li>
                    @Ajax.RawActionLink("<i class='fa fa-ellipsis-h fa-fw'></i>重设密码",
                        "SetPassword", "User",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "pwd-container", OnComplete = "onAjaxPwdComplete", OnSuccess = "OnSuccessLink" },
                        new { title = "重设密码" })                   
                </li>
                <li>
                    @{
                        var tooltip = Model.IsActive ? "锁定" : "激活";
                        tooltip = tooltip + "用户";
                    }

                    <a href="#" data-url="@Url.Action("IsActive", new {id = Model.Id})" class="active-item" title="@tooltip">
                        @Html.Raw(Model.IsActive? "<i class='fa fa-lock fa-fw'></i>锁定" : "<i class='fa fa-unlock fa-fw'></i>激活")
                    </a>
                </li>
                <li role="separator" class="divider"></li>
                <li>
                    <a href="#" data-url="@Url.Action("Delete", new {id = Model.Id})" class="delete-item" title="删除用户">
                      <i class="fa fa-trash-o fa-fw"></i>删除
                    </a>
                </li>
            </ul>
        </div>

    </td>
    <td>
        <img src="@(string.IsNullOrEmpty(Model.PhotoUrl)? SettingsManager.User.DefaultAvatar :Model.PhotoUrl)" alt="@Model.UserName" class="img-circle" style="height:40px;" />
    </td>
    <td>
        @Html.DisplayFor(modelItem => Model.UserName)

    </td>
    <td>
        @Html.DisplayFor(modelItem => Model.Email)
    </td>
    <td>
        @Html.DisplayFor(modelItem => Model.RealName)
    </td>
    <td>
        @Html.DisplayFor(modelItem => Model.Mobile)
    </td>

    <td>
        @Html.DisplayFor(modelItem => Model.IsActive)
    </td>
    <td>
        @Html.DisplayFor(modelItem => Model.CreateDate)
    </td>



</tr>

